<template>
	<view class="content font_family" v-if="detail">

		<view class="title_box">
			<view class="top title">行程预定详情</view>
      <view class="intro">
        <view class="intro-left">
          <!-- <image src="/static/public/car.png" /> -->
        </view>
        <view class="intro-right">
          <view class="top">
            <view>伊犁化境云端牧哥</view>
            <view class="tag">
              <u-icon name="calendar" color="#61916f" labelColor="#61916f" label="06-15" labelSize="13"></u-icon>
            </view>
          </view>
          <view class="bottom">
            ¥1500
          </view>
        </view>
      </view>
		</view>
    <view class="second">
      <view class="title">出行信息</view>
      <view class="info" v-for="(item,index) in travel_arr">
        <view><text>{{item.name}}</text><text style="padding-left: 20rpx">142061******896</text></view>
        <view class="phone">{{item.tel}}</view>
      </view>
    </view>
		<!-- 二维码 -->
<!--		<view class="qr_code">
			<view class="tip">
				<u-divider text="用户信息"></u-divider>
			</view>
			&lt;!&ndash; <view class="code_text">
				凭「入园码」直接入园
			</view> &ndash;&gt;
			<view class="img_box f_d f_zj" v-for="(item,index) in travel_arr" :key="index">

				<view class="text">
					{{item.name}}-{{item.tel}}
				</view>

			</view>

		</view>-->
		<!-- 订单信息 -->
		<view class="order_msg">
			<view class="title">
				订单信息
			</view>
			<view class="item" >
				<text>订单编号：</text>
				<text class="gray">{{detail.order_no}}</text>
			</view>
			<view class="item">
				<text>预定日期：</text>
				<text class="gray">{{detail.yd_time}}</text>
			</view>

			<view class="item">
				<text>下单时间：</text>
				<text class="gray">{{detail.createtime}}</text>
			</view>
		</view>
	</view>
</template>

<script>
	// import { hx_code } from '@/api/user.js'
	export default {
		data() {
			return {
				detail: '',
				see_more_show: false, //超出两个展示更多按钮
				see_more_action: false, //是否展示更多
				travel_arr: '',
				set_qr_code: '',
			}
		},
		onLoad(e) {
	    console.log(e.detail);
			this.detail = JSON.parse(e.detail)
			let travel = JSON.parse(e.travel)
					
			this.detail.travel=travel;
			console.log(this.detail.travel);
			if (this.detail.travel.length > 1) {
				this.travel_arr = this.detail.travel.slice(0, 1)
			} else {
				this.travel_arr = this.detail.travel
			}
			
			
			// if (this.detail.travel.length > 1) {
			// 	this.travel_arr = this.detail.travel.slice(0, 1)
			// } else {
			// 	this.travel_arr = this.detail.travel
			// }
			
		},
		methods: {
			see_more() {
				if (!this.see_more_action) {
					this.travel_arr = this.detail.travel
				} else {
					this.travel_arr = this.detail.travel.slice(0, 1)
				}
				this.see_more_action = !this.see_more_action
			},
			// get_qrcode(code, index) {
			// 	this.set_qr_code = index
			// 	let obj = {
			// 		order_no: this.detail.order_no,
			// 		code
			// 	}
			// 	hx_code(obj).then(res => {
			// 		// console.log(res)
			// 		if (res.code == 1) {}
			// 	})
			// }
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		padding: 30rpx;



		.title_box {

			padding: 30rpx;
			background-color: #ffffff;
			border-radius: 12rpx 12rpx 12rpx 12rpx;

			.top {
				font-weight: 500;
				font-size: 30rpx;
				padding-bottom: 20rpx;
				//border-bottom: 1rpx solid #D8D8D8;
			}

			.bottom {
				margin-top: 20rpx;
				font-weight: 400;
				font-size: 36rpx;
				color: #333333;
			}
		}

		.qr_code {
			margin-top: 30rpx;
			padding: 30rpx;
			border-radius: 12rpx 12rpx 12rpx 12rpx;
			background-color: #ffffff;

			.tip {
				width: 300rpx;
				margin: 0 auto;
			}

			.code_text {
				margin-top: 30rpx;
				font-weight: 400;
				font-size: 28rpx;
			}

			.img_box {
				margin-top: 30rpx;
				width: 100%;
				background: #F4F5F7;
				border-radius: 18rpx 18rpx 18rpx 18rpx;
				position: relative;
				padding: 30rpx 0rpx;

				.left {
					height: 100%;
					position: absolute;
					left: 0;
					top: 0;
					width: 68rpx;
					background: #232323;
					border-radius: 18rpx 18rpx 18rpx 18rpx;
					font-weight: 400;
					font-size: 28rpx;
					color: #FFFFFF;
					writing-mode: vertical-rl;
					// transform: rotate(180deg);
				}

				.img {
					width: 280rpx;
				}

				.text {
					font-weight: 400;
					font-size: 22rpx;
					color: #0A0A0A;
					margin-top: 20rpx;
				}

				.btn {
					font-weight: 400;
					font-size: 22rpx;
					color: #3CBDFF;
					background: #F9FCFE;
					border-radius: 19rpx 19rpx 19rpx 19rpx;
					padding: 10rpx 24rpx;
					margin-top: 20rpx;
				}
			}

			.see_more {
				text-align: center;
				margin-top: 20rpx;
				color: #3CBDFF;
			}
		}

		.order_msg {
			background: #FFFFFF;
			border-radius: 12rpx;
			padding:30rpx 30rpx 30rpx 30rpx;
			margin-top: 30rpx;



			.item {
				font-weight: 400;
				font-size: 22rpx;
				color: #333333;
				margin-top: 20rpx;
        border-bottom: 1px solid #f6f6f6;
        padding-bottom: 20rpx;
			}
		}
	}
  .title {
    margin-top: 30rpx;
    position: relative;
    padding-left: 20rpx;
    font-size: 32rpx;
    line-height: 40rpx;
  }

  .title::after {
    content: "";
    width: 8rpx;
    height: 30rpx;
    background-color: #61916f;
    position: absolute;
    left: 0;
    top: 5rpx;
    border-radius: 99rpx;
  }
  .tag{
    background-color: #F3F8F5;
    color: #61916f;
  }
  .intro{
    display: flex;
    margin-top: 30rpx;
    &-left{

      image{
        width: 180rpx;
        height: 180rpx;
      }
    }
    &-right{
      margin-left: 30rpx;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      .top{
        .tag{
          background-color: #F3F8F5;
          width: 120rpx;
          padding: 10rpx;
          border-radius: 10rpx;
          margin-top: 10rpx;

        }
      }
      .bottom{
        padding-bottom: 20rpx;
        font-size: 36rpx;
      }
    }
  }
  .second{
    margin-top: 30rpx;
    padding:30rpx;
    background-color: white;
    border-radius: 30rpx;
    .info{
      padding: 20rpx;
      background-color: #F6F6F6;
      border-radius: 30rpx;
      margin-top: 30rpx;
      .phone{
        margin-top: 10rpx;
        color: gray;
      }
    }
  }
  .gray{
    color: gray;
  }


</style>